<template>
  <div class="headerCrumb">
    <el-breadcrumb :separator-icon="ArrowRight">
      <template v-for="item in breadcrumbs" :key="item.name">
        <el-breadcrumb-item :to="item.path">{{item.name}}</el-breadcrumb-item>
      </template> 
    </el-breadcrumb>
  </div>
</template>

<script setup lang="ts">
import { ArrowRight } from '@element-plus/icons-vue'
import { computed } from 'vue'
import { mapPathToBreadCrumbs } from '@/utils/map-menus'
import { useRoute } from 'vue-router'
import useLoginStore from '@/store/login/login';
const route = useRoute()

const userMenus = useLoginStore().userMenus

const breadcrumbs = computed(() => {
  return mapPathToBreadCrumbs(route.path, userMenus)
})

</script>

<style scoped lang="less">

</style>